<template>
  <div id="device4gEdit">
    <Modal v-model="modal.show"  :loading="modal.loading" :title="modal.title"  :mask-closable="false" :footer-hide=true width="800px" :closable="false">
      <Form ref="formGbServer" :model="rowData" label-position="right" :label-width="labelWidth" >
        <FormItem :label="$t('server')" >
          <Row :gutter="4">
            <Col span="14">
              <gbserverselect ref="edtGbServerSelect"
                              v-model="rowData.gbServerId"
                              width="300px"
                              @on-change="gbChange"
                              :readonly="modal.readonly"/>
            </Col>
            <Col span="10">
              <Button v-show="!batchAdd && modal.action=='ADD'" @click="changeForm">{{$t('register_more')}}</Button>
              <Button v-show="batchAdd && modal.action=='ADD'" @click="changeForm">{{$t('register_one')}}</Button>
            </Col>
          </Row>
        </FormItem>
        <FormItem v-show="modal.action=='ADD'">
          <GbCodeRule v-model="codeRule"></GbCodeRule>
        </FormItem>
      </Form>
      <!-- 单个注册  -->
      <Form v-show="!batchAdd" ref="singleValidate" :model="rowData" label-position="right" :label-width="labelWidth" :rules="rules1">
        <FormItem :label="$t('code')" >
          <Row :gutter="2">
            <Col span="12"><Input v-model="rowData.codePrefix" :disabled="true"  maxlength=20></Input> </Col>
            <Col span="12"><Input :placeholder="$t('enter_6digits')" v-model="rowData.codeSuffix"  maxlength=6></Input> </Col>
          </Row>
        </FormItem>
        <FormItem :label-width="labelWidth" :label="$t('manually_modify')">
          <Row :gutter="2">
            <Col span="10">
              <Input :placeholder="$t('enter_20digits')" v-model="rowData.code" :readonly="modal.readonly"  maxlength=20 />
<!--              <Form :label-width="labelWidth">
                <FormItem prop="code">
                  <Row><Col span="24">
                    <Input :placeholder="$t('enter_20digits')" v-model="rowData.code" class="half-input" :readonly="modal.readonly"  maxlength=20 />
                  </Col></Row>
                </FormItem>
              </Form>-->
            </Col>
            <Col span="14">
              <Form :label-width="80">
                <FormItem :label="$t('imei_code')">
                  <Row><Col span="24">
                    <Input :placeholder="$t('imei_code')" v-model="rowData.imeiCode" :readonly="modal.readonly"  maxlength=20 />
                  </Col></Row>
                </FormItem>
              </Form>
            </Col>
          </Row>
        </FormItem>
        <FormItem :label="$t('name')" prop="name"><Input v-model="rowData.name" :readonly="modal.readonly"  maxlength=100></Input></FormItem>
        <FormItem :label-width="labelWidth" :label="$t('video_channel')">
          <Row :gutter="2">
            <Col span="10">
              <Form :label-width="labelWidth">
                <FormItem  prop="defaultChannel"><Input v-model="rowData.defaultChannel" :readonly="modal.readonly"  maxlength=20></Input></FormItem>
              </Form>
            </Col>
            <Col span="14">
              <Form :label-width="80">
                  <FormItem :label="$t('alarm_channel')">
                    <Row><Col span="24">
                      <Input v-model="rowData.defaultAlarmChannel" :readonly="modal.readonly"></Input>
                    </Col></Row>
                  </FormItem>
              </Form>
            </Col>
          </Row>
        </FormItem>
<!--        <FormItem label="视频通道" prop="defaultChannel"><Input v-model="rowData.defaultChannel" :readonly="modal.readonly"></Input></FormItem>
        <FormItem label="报警通道"><Input v-model="rowData.defaultAlarmChannel" :readonly="modal.readonly"></Input></FormItem>-->
        <FormItem :label-width="labelWidth" :label="$t('device_status')">
          <Row :gutter="2">
            <Col span="13">
              <Form :label-width="0">
                <FormItem >
                  <RadioGroup v-model="rowData.state">
                    <Radio :label=1 border>{{$t('device_status_1')}}</Radio>
                    <Radio :label=2 border>{{$t('device_status_2')}}</Radio>
                    <Radio :label=3 border>{{$t('device_status_3')}}</Radio>
                  </RadioGroup>
                </FormItem>
              </Form>
            </Col>
            <Col span="10">
              <Form :label-width="80" >
                <FormItem :label="$t('media_protocol')">
                  <Row><Col span="24">
                  <Select v-model="rowData.streamMode" :placeholder="$t('all')"  maxlength=20 >
                    <Option v-for="item in streamModes" :value="item.name" :key="item.code">{{ item.desc }}</Option>
                  </Select>
                  </Col></Row>
                </FormItem>
              </Form>
            </Col>
          </Row>
        </FormItem>
        <FormItem :label="$t('device_type')">
          <Row :gutter="2">
            <Col span="8">
              <Select  v-model="rowData.type" :placeholder="$t('all')" >
                <Option v-for="item in deviceType" :value="item.code" :key="item.code">{{ item.desc }}</Option>
              </Select>
            </Col>
            <Col span="2"></Col>
            <Col span="14">
              <Form :label-width="80" >
                <FormItem :label="$t('coordinate_system')">
                  <Row><Col span="24">
                    <RadioGroup v-model="rowData.coordinateSystem">
                      <Radio label="WGS84" border>WGS84</Radio>
                      <Radio label="GCJ02" border>GCJ02</Radio>
                    </RadioGroup>
                  </Col></Row>
                </FormItem>
              </Form>
            </Col>
          </Row>
        </FormItem>
        <FormItem :label="$t('subscribe')">
            <Row :gutter="2">
            <Col span="6">
              <Form><FormItem :label="$t('location')">
              <i-switch v-model="rowData.boolSubscriberPosition" true-color="#13ce66" false-color="#ff4949" size="large" style="width:70px" :readonly="modal.readonly">
                <span slot="open">{{$t('subscribe')}}</span>
                <span slot="close">{{$t('un_subscribe')}}</span>
              </i-switch>
              </FormItem>
              </Form>
            </Col>
            <Col span="6">
              <Form>
                <FormItem :label="$t('interval')">
                  <InputNumber :max="60" :min="5" :step="1" :active-change="false" v-model="rowData.subscriberPositionInterval"/>
                </FormItem>
              </Form>
            </Col>
            <Col span="6">
              <Form>
                <FormItem :label="$t('catalog')">
                  <i-switch v-model="rowData.boolSubscriberCatalog"  true-color="#13ce66" false-color="#ff4949" size="large" style="width:70px" :readonly="modal.readonly">
                    <span slot="open">{{$t('subscribe')}}</span>
                    <span slot="close">{{$t('un_subscribe')}}</span>
                  </i-switch>
                </FormItem>
              </Form>
            </Col>
              <Col span="6">
                <Form>
                  <FormItem :label="$t('alarm')">
                    <i-switch v-model="rowData.boolSubscriberAlarm" true-color="#13ce66" false-color="#ff4949" size="large" style="width:70px" :readonly="modal.readonly">
                      <span slot="open">{{$t('subscribe')}}</span>
                      <span slot="close">{{$t('un_subscribe')}}</span>
                    </i-switch>
                  </FormItem>
                </Form>
              </Col>
            </Row>
        </FormItem>
        <FormItem :label="$t('enabled_audio')">
          <i-switch v-model="rowData.hasAudio"  true-color="#13ce66" false-color="#ff4949" size="large" style="width:70px" :readonly="modal.readonly">
            <span slot="open">{{$t('enabled')}}</span>
            <span slot="close">{{$t('disabled')}}</span>
          </i-switch>
        </FormItem>
      </Form>
      <!-- 批量注册      -->
      <Form v-show="batchAdd" ref="batchValidate" :model="rowData" label-position="right" :label-width="100" >
        <FormItem :label-width="0">
          <Row>
            <Col span="12">
              <Form label-position="right" :label-width="100">
                <FormItem :label="$t('begin_num')">
                  <InputNumber controls-outside v-model="batch.beginNum" :min="1" :max="10000" style="width: 100px;"></InputNumber>
                  <Button @click="getBeginNum">{{$t('get_from_api')}}</Button>
                </FormItem>
                <FormItem :label="$t('from')">
                  <Input controls-outside v-model="batch.beginCode" :disabled="true" style="width:200px"></Input>
                </FormItem>

              </Form>
            </Col>
            <Col span="12">
              <Form label-position="right" :label-width="100">
                <FormItem :label="$t('quantity')">
                  <InputNumber controls-outside v-model="batch.num" :min="1" :max="50" style="width: 100px;"></InputNumber>
                </FormItem>
                <FormItem :label="$t('to')">
                  <Input v-model="batch.endCode" :disabled="true" style="width:200px"></Input>
                </FormItem>
              </Form>
            </Col>
          </Row>
        </FormItem>
      </Form>
      <Form ref="footForm" :model="rowData" label-position="right" :label-width="labelWidth">
        <FormItem :label="$t('organization')">
          <OrganizationTree ref="edtOrgSelect"
                     width="200px"
                     v-model="rowData.orgId"
                     :readonly="modal.readonly"
                     prop="orgId"></OrganizationTree>
        </FormItem>
        <FormItem v-show = "!batchAdd" :label="$t('select_people')">
          <UserSelect ref="edtUserSelect" v-model="rowData.userId"
                      v-bind:srhValue="rowData.userName"
                      width="200px"
                      :readonly="modal.readonly"> </UserSelect>
        </FormItem>

        <FormItem>
          <div style="float: right;">
            <Button v-show="modal.action!='VIEW'" type="primary"  @click="save" >{{$t('save')}}</Button>
            <Button @click="close">{{$t('cancel')}}</Button>
          </div>
        </FormItem>
      </Form>

<!--      <Batch4gAdd ref="batch4gAdd"></Batch4gAdd>-->
    </Modal>
  </div>
</template>
<script>
import Device from '@/api/Device';
import OrganizationTree from '@/components/topnav/OrganizationTree';
import gbserverselect from '@/components/topnav/GbServerSelect.vue';
import UserSelect from "_c/topnav/UserModelSelect";
import CodeRule from "@/api/CodeRule";
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
import GbCodeRule from "@/view/GbServer/GbCodeRule";
import batchAddDevice from "./Device4gBatchAdd"
import {getOne} from '@/api/gbserver';
import EnumQuery from "@/api/EnumQuery";
import {apiResult} from "@/libs/util";
//import Orgselect from '@/components/topnav/OrgSelect.vue';

export default {

  name: "device4gEdit",
  components: {gbserverselect,OrganizationTree,UserSelect,Treeselect,GbCodeRule,batchAddDevice},
  watch: {
    'rowData.gbServerId'(newValue, oldValue) {
      if (!!newValue){
        getOne(JSON.stringify({id:newValue})).then(res => {
          apiResult(res.data,false,result=>{
            this.codeRule.cityId = result.data.cityId;
            this.codeRule.businessId = result.data.businessId;
            this.codeRule.centerTypeId = result.data.centerTypeId;
            if (!this.isZhCn){
              this.codeRule.deviceTypeId = "113";
              this.codeRule.netIdentityId = "7";
            }else{
              this.codeRule.deviceTypeId = result.data.deviceTypeId;
              this.codeRule.netIdentityId = result.data.netIdentityId;
            }


            this.rowData.gbServerCode = result.data.code;
            this.rowData.gbServerName = result.data.name;
            this.rowData.gbServerDomain = result.data.domain;
            this.rowData.cityId = result.data.cityId;
            this.rowData.businessId = result.data.businessId;
            //console.log("Device4gEdit::isZhCn=%o",this.isZhCn);
            if (!this.isZhCn){
              this.rowData.netIdentityId = '7';
              this.rowData.deviceTypeId = '113';
            }else{
              this.rowData.netIdentityId = result.data.netIdentityId;
              this.rowData.deviceTypeId = result.data.deviceTypeId;
            }
            this.rowData.centerTypeId = result.data.centerTypeId;
            //this.rowData.hasAudio = res.data.data.hasAudio;

            this.rowData.codePrefix = result.data.domain + this.codeRule.deviceTypeId + this.codeRule.netIdentityId;
            this.batch.codePrefix = result.data.domain + this.codeRule.deviceTypeId + this.codeRule.netIdentityId;
          })
        })
      }
    },
    'rowData.codeSuffix'(newValue, oldValue) {
      if (!!newValue){
        this.rowData.code = this.rowData.codePrefix + this.rowData.codeSuffix;
        this.rowData.defaultChannel = this.rowData.code;
        this.rowData.defaultAlarmChannel = this.rowData.code;
      }
    },
    'codeRule.deviceTypeId'(newValue, oldValue){
      if (!!newValue){
        this.rowData.codePrefix = this.rowData.gbServerDomain + this.codeRule.deviceTypeId + this.codeRule.netIdentityId;
        this.batch.codePrefix = this.rowData.gbServerDomain + this.codeRule.deviceTypeId + this.codeRule.netIdentityId;
      }
    },
    'codeRule.netIdentityId'(newValue, oldValue){
      if (!!newValue){
        this.rowData.codePrefix = this.rowData.gbServerDomain + this.codeRule.deviceTypeId + this.codeRule.netIdentityId;
        this.batch.codePrefix = this.rowData.gbServerDomain + this.codeRule.deviceTypeId + this.codeRule.netIdentityId;
      }
    },
    'batch.beginNum'(newValue, oldValue){
      this.calcBatchCode();
    },
    'batch.num'(newValue, oldValue){
      this.calcBatchCode();
    },
    'batch.codePrefix'(newValue, oldValue){
      this.calcBatchCode();
    },

  },
  computed:{
    rules1(){
      return{
        code:[{required: true, message: this.$t('code_must_be_enter'), trigger: 'blur'},
          {type:'string',min:20,max:20,message: this.$t('code_must_be_20digits'), trigger: 'blur'}
        ],
        name:[{required: true, message: this.$t('name_must_be_enter'), trigger: 'blur'}],
        defaultChannel:[{required: true, message: this.$t('channel_must_be_enter'), trigger: 'blur'},{type:'string',min:20,max:20,
          message: this.$t('code_must_be_20digits'), trigger: 'blur'}],
        orgId:[{required: true, message: this.$t('organization_must_be_enter'), trigger: 'blur'}],
      }
    },
  },
  data(){
    return{
      apiDevice: new Device(),
      enumQuery: new EnumQuery(),
      labelWidth:120,

      batchAdd:false,
      api: new CodeRule(),
      batch:{
        beginNum:1,
        num:1,
        beginCode:null,
        endCode:null,
        codePrefix:null,
        gbServerId:null,
        type:2,
        cate:2,
        orgId:null,
      },
      cityTree:{
        placeholder: "",
        onSelect:function (node, instanceId){},
        onDeselect:function (node, instanceId){}
      },
      codeRule:{
        cityId: null,
        businessId: null,
        centerTypeId: null,
        deviceTypeId: '113',
        netIdentityId: '7',
      },
      modal:{
        show:false,
        loading:false,
        loading1:false,
        loading2:false,
        readonly:false,
        title:"",
        action:"VIEW",
        callback:null
      },
      rowData: this.initRow(),
      cityCodes:[],
      businessCodes:[],
      centerCodeType:[],
      deviceCodeType:[],
      codeNetIdentity:[],

      deviceType:[
        /*{code: 1,desc: "4G执法仪"},
        {code: 2,desc: "5G执法仪"},
        {code: 3,desc: "安全帽"},
        {value: 4,desc: "IPC"},
        {value: 5,desc: "布控球"},
        {value: 6,desc: "其它类型"},*/
      ],
      streamModes:[],
      isZhCn:true,
    }
  },
  methods:{
    //计算开始的结束编号
    calcBatchCode(){
      let codeFix = this.batch.codePrefix;
      if (!!!codeFix){
        if (!!this.rowData.gbServerCode){
          codeFix = this.rowData.gbServerCode.substr(0,14);
        }
      }

      //计算指注册的开始编号和结束编号
      if (!!this.batch.beginNum && !!this.batch.num && !!codeFix){
        let code = this.batch.beginNum.toString();
        while (code.length < 6){
          code = "0" + code;
        }
        this.batch.beginCode = codeFix + code;
        if (this.batch.num == 1){
          this.batch.endCode=this.batch.beginCode;
          return;
        }

        code = (this.batch.beginNum + (this.batch.num - 1)).toString();
        while (code.length < 6){
          code = "0" + code;
        }
        this.batch.endCode = codeFix + code;
      }
    },
    changeForm(){
      this.batchAdd = !this.batchAdd;
    },
    close: function(){
      this.modal.show = false;
    },
    gbChange: (data)=>{;},
    //从后台取起始编号
    getBeginNum(){
      if (!!!this.rowData.gbServerId){
        this.$Message.error(this.$t("server_must_be_enter"));
        return;
      }
      let codeFix = this.batch.codePrefix;
      if (!!!codeFix){
        if (!!this.rowData.gbServerCode){
          codeFix = this.rowData.gbServerCode.substr(0,14);
        }
      }

      this.apiDevice.getBeginCode(codeFix).then(res => {
          apiResult(res.data,false,result=>{
            this.batch.beginNum = result.data;
          });

      })
    },

    initRow:function (){
      let newRow={
        cate:2,
        type:1,
        id:null,
        code:null,
        name:null,
        orgId:null,
        userId:null,
        userName:null,
        defaultChannel:null,
        defaultAlarmChannel:null,
        state:1,
        gbServerId:null,
        gbServerCode:null,
        gbServerName:null,
        gbServerDomain:null,
        cityId:null,
        businessId:null,
        netIdentityId:null,
        deviceTypeId:null,
        centerTypeId:null,
        codePrefix:null,
        codeSuffix:null,
        num:1,
        coordinateSystem:"WGS84",
        streamMode:1,
        subscriberPositionInterval:30,
        subscriberPosition:0,
        subscriberCatalog:0,
        subscriberAlarm:0,
        boolSubscriberPosition:false,
        boolSubscriberCatalog:false,
        boolSubscriberAlarm:false,
        hasAudio:true,
        imeiCode:null,
      }
      if (!!this.streamModes && this.streamModes.length>0){
        newRow.streamMode=this.streamModes[0].name;
      }
      return newRow;
    },
    openDialog: function (action,row, callback) {
      //console.log(row);

      this.modal.show=true;
      this.modal.readonly=false;
      this.modal.callback = callback;
      this.modal.show = true;
      this.modal.action = action;
      this.batchAdd = false;
      if (action=="ADD"){
        this.modal.title=this.$t("add");
        this.rowData = this.initRow();
        this.$refs["singleValidate"].resetFields();
        this.modal.readonly=false;
      }else if (action=="VIEW"){
        this.modal.title=this.$t("browse");
        this.modal.readonly=true;
      }else if (action=="EDIT"){
        this.modal.title=this.$t("edit");
        this.modal.readonly=false;
      }
      if (row != null) {
        this.rowData = row;
        this.rowData.boolSubscriberPosition=false;
        this.rowData.boolSubscriberCatalog=false;
        this.rowData.boolSubscriberAlarm=false;
        if (this.rowData.subscriberPosition > 0){this.rowData.boolSubscriberPosition=true;}
        if (this.rowData.subscriberCatalog > 0){this.rowData.boolSubscriberCatalog=true;}
        if (this.rowData.subscriberAlarm > 0){this.rowData.boolSubscriberAlarm=true;}
      }
      if (action=="VIEW" || action=="EDIT" ){
        this.rowData.codePrefix = this.rowData.code.substr(0,14);
        this.rowData.codeSuffix = this.rowData.code.substr(14,20);
        this.codeRule.cityId = this.rowData.cityId;
        this.codeRule.businessId = this.rowData.businessId;
        this.codeRule.centerTypeId = this.rowData.centerTypeId;
        this.codeRule.deviceTypeId = this.rowData.deviceTypeId;
        this.codeRule.netIdentityId = this.rowData.netIdentityId;
      }else{
        this.codeRule.cityId = null;
        this.codeRule.businessId = null;
        this.codeRule.centerTypeId = null;
        this.codeRule.deviceTypeId = null;
        this.codeRule.netIdentityId = null;

        this.batch.beginNum=1;
        this.batch.num=1;
        this.batch.beginCode=null;
        this.batch.endCode=null;
        this.batch.codePrefix=null;
      }
      //console.log(">>>>>>>>Device4gEdit.openDialog: rowData=%o",this.rowData);

    },
    save: function(){
      let that = this;
      /** 单个新增 */
      if (!this.batchAdd){
        this.$refs["singleValidate"].validate((valid) => {
          if (that.modal.action == "VIEW"){that.close();}
          if (valid) {
            if (!that.rowData.gbServerId){
              that.$Message.error(this.$t("server_must_be_enter"));
              return;
            }
            if (!that.rowData.code){
              that.$Message.error(this.$t("code_must_be_enter"));
              return;
            }
            if (that.rowData.boolSubscriberPosition){
              that.rowData.subscriberPosition = 1;
            }else{
              that.rowData.subscriberPosition = 0;
            }
            if (that.rowData.boolSubscriberCatalog){
              that.rowData.subscriberCatalog = 1;
            }else{
              that.rowData.subscriberCatalog = 0;
            }
            if (that.rowData.boolSubscriberAlarm){
              that.rowData.subscriberAlarm = 1;
            }else{
              that.rowData.subscriberAlarm = 0;
            }

            that.rowData.cate =2;
            if (that.rowData.id == null){
              this.apiDevice.addDevice(JSON.stringify(that.rowData)).then(res => {
                apiResult(res.data,true,result=>{
                  if (!!that.modal.callback) that.modal.callback();
                  that.close();
                })
              })
            }else{
              this.apiDevice.updateDevice(JSON.stringify(that.rowData)).then(res => {
                apiResult(res.data,true,result=>{
                  if (!!that.modal.callback) that.modal.callback();
                  that.close();
                })
              })
            }
          } else {
            that.$Message.error(this.$t('data_check_error'));
            return;
          }
        })
      }else {
        //批量添加
        if (!!!that.rowData.gbServerId){
          that.$Message.error(this.$t("server_must_be_enter"));
        }
        if (!!!this.codeRule.deviceTypeId){
          that.$Message.error(this.$t("device_type_must_be_enter"));
        }
        if (!!!this.codeRule.netIdentityId){
          that.$Message.error(this.$t("network_identity_must_be_enter"));
        }
        that.batch.gbServerId = that.rowData.gbServerId;
        that.batch.orgId = that.rowData.orgId;
        that.rowData.cate =2;
        this.apiDevice.batchAddDevice(JSON.stringify(that.batch)).then(res => {
          apiResult(res.data,true,result=>{
            if (!!that.modal.callback) that.modal.callback();
            that.close();
          })
        })
      }

    },
  },
  mounted() {

    this.api.findCodeCity().then(res=>{
      //console.log("******* Device4gEdit.mounted: res=%o",res)
      this.testCity=[];
      apiResult(res.data,false,result=>{
        for(let i in result.data){
          const parent ={
            label:result.data[i].label,
            id:result.data[i].value,
            children:[]
          }
          this.testCity.push(parent);
          if (!! result.data[i].children){
            for(let j in result.data[i].children){
              this.api.genChildren(parent,result.data[i].children[j])
            }
          }
        }
        //console.log(this.testCity);

        //this.cityCodes=[];
        this.cityCodes=this.testCity;//res.data.data;

      })

    })
    this.api.findCodeBusiness().then(res=>{
        this.businessCodes=[];
      apiResult(res.data,false,result=>{
        this.businessCodes=result.data;
      })
    })
    this.api.findCodeType().then(res=>{
      this.centerCodeType=[];
      this.deviceCodeType=[];
      apiResult(res.data,false,result=>{
        this.centerCodeType=res.data.data;
        this.deviceCodeType=this.centerCodeType;
      })
    })

    this.api.findCodeNetIdentity().then(res=>{
      this.codeNetIdentity=[];
      apiResult(res.data,false,result=>{
        this.codeNetIdentity=result.data;
      })
    })
    /** 查询设备类型 */
    this.enumQuery.get("DeviceType").then(res => {
      apiResult(res.data,false,result=>{
        this.deviceType = result.data;
        if (!!this.deviceType && this.deviceType.length>0){
          this.deviceType.forEach(item=>{
            item.desc = this.$t("device_type_"+item.code);
          })
        }
      })
    })

    /** 查询流媒体协议 */
    this.enumQuery.get("EnumStreamMode").then(res => {
      console.log(res)
      apiResult(res.data,false,result=>{
        this.streamModes = result.data;
        //console.log(this.streamModes)
        if (!!this.streamModes && this.streamModes.length>0){
          this.streamModes.forEach(item=>{
            item.desc = this.$t("stream_mode_"+item.code);
          })
          this.rowData.streamMode=this.streamModes[0].name;
        }



      })

    })
    //是不中文版
    this.isZhCn = (this.$store.state.app.local === 'zh-CN' || this.$store.state.app.local === 'zh-TW');
  },
}
</script>
<style lang="less">
@import ".././template";
.half-input{
  width: 280px;
}
</style>
